package com.sscaipiao.android.activity;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Spinner;

import com.sscaipiao.android.R;
import com.sscaipiao.android.adapter.MineSpinnerAdapter;
import com.sscaipiao.android.common.Constants;
import com.sscaipiao.android.model.User;

public class MineActivity extends Activity implements OnClickListener,
		OnItemClickListener {

	private Spinner spinner;
	private ImageView mine_arrow_img;

	private ListView mListView;

	private User user;
	private List<Map<String, Object>> mList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
		.detectDiskReads().detectDiskWrites().detectNetwork()
		.penaltyLog().build());
		StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
		.detectLeakedSqlLiteObjects().detectLeakedClosableObjects()
		.penaltyLog().penaltyDeath().build());
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mine);

		Intent i = this.getIntent();
		if (!i.equals(null)) {
			Bundle b = i.getExtras();
			if (b != null) {
				if (b.containsKey(Constants.USER)) {
					user = (User) b.get(Constants.USER);
				}
			
			}
		}
		
		spinner = (Spinner) findViewById(R.id.mine_spinner);
		mListView= (ListView)findViewById(R.id.hall_listView);
		hemai = (ImageView) findViewById(R.id.hall_imageView_hemai);
		kaijiang = (ImageView) findViewById(R.id.hall_imageView_kaijiang);
		wode = (ImageView) findViewById(R.id.hall_imageView_wode);
		gengduo = (ImageView) findViewById(R.id.hall_imageView_gengduo);
		
		hemai.setOnClickListener(this);
		kaijiang.setOnClickListener(this);
		wode.setOnClickListener(this);
		gengduo.setOnClickListener(this);
		
		List<String>  filters =new ArrayList<String>();
		filters.add(getResources().getString(R.string.mine_orders)); 
		filters.add(getResources().getString(R.string.mine_trace)); 
		filters.add(getResources().getString(R.string.mine_init_together)); 
		filters.add(getResources().getString(R.string.mine_participant_together)); 
		
		filters.add(getResources().getString(R.string.mine_bingo_list)); 
		
		MineSpinnerAdapter _MyAdapter=new MineSpinnerAdapter(this, filters);
			//绑定Adapter
		spinner.setAdapter(_MyAdapter);
		

	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub

	}

	private ImageView hall;
	private ImageView hemai;
	private ImageView kaijiang;
	private ImageView wode;
	private ImageView gengduo;
}
